package org.lansir.af.database;


/**
 * 
 * @author lee
 *
 */
public class DataRowTrusty extends DataRow {	
	//各个字段的索引
	public static class fid {
		public static final int ID = 0;
		public static final int TYPE = 1;  //0 为信任, 1为黑名单
		public static final int Name= 2;
		public static final int MemberID = 3;		
	};
	
	public static final int DataTrustyTypeTrust = 0;
	public static final int DataTrustyTypeDanger = 1;
	
	// Table definition
	private final DataField[] TableDef = {
			new DataField(fid.ID, "_ID", DataField.Type.INT, true, true),
			new DataField(fid.TYPE, "Type", DataField.Type.INT, true,false),
			new DataField(fid.Name, "Name", DataField.Type.TEXT, true,false),
			new DataField(fid.MemberID, "MemberID", DataField.Type.TEXT, true,false),};
	
	private long lID;
	private int lType;
	private String sName;
	private String sMemberID;
	
	public DataRowTrusty(Database userdb) {
		super(userdb);
		setTableDefinition(TableDef);
	}

	@Override
	public String getTableName() {
		return Database.sTableNameTrustys;
	}

	@Override
	public void getValuesFromDataRow() {
		setId(value(fid.ID).asLong());
		setType(value(fid.TYPE).asInt());
		setName(value(fid.Name).asString());
		setMemberID(value(fid.MemberID).asString());
	}

	@Override
	public void setValuesForDataRow() {
		clearContentValues();
		value(fid.TYPE).set(getType());
		value(fid.Name).set(getName());
		value(fid.MemberID).set(getMemberID());
	}

	public long getId() {
		return lID;
	}

	public void setId(long Id) {
		lID = Id;
	}

	public int getType() {
		return lType;
	}

	public void setType(int type) {
		this.lType = type;
	}

	public String getName() {
		return sName;
	}

	public void setName(String Name) {
		sName = Name;
	}
	
	public void setMemberID(String sID)
	{
		sMemberID = sID;
	}
	
	public String getMemberID()
	{
		return sMemberID;
	}
	

	
}
